package com.ocom.payconfig.dao;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ocom.common.entity.card.EntityXfVideocallGroup;
import com.ocom.common.request.videocall.request.GetVideocallGroupRequest;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface IDaoXfVideocallGroup extends BaseMapper<EntityXfVideocallGroup> {


    @Select("<script>" +
            "SELECT " +
            " g.*, m.merch_name " +
            " FROM " +
            " xf_videocall_group g" +
            " LEFT JOIN xf_merchant_info m ON g.com_id = m.com_id\n" +
            " AND g.merch_id = m.merch_id\n" +
            " WHERE\n" +
            " g.com_id = #{companyId}" +
            "<when test=\"merchId !=null\" > "+
            " and g.merch_id = #{merchId}" +
            "</when>" +
            "</script>")
    List<EntityXfVideocallGroup> getVideocallGroup(Long companyId, Long merchId);
}
